package com.itheima.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

@Controller
public class TestContrroler {
    /*
    springmvc DispatcherServlet

        String path = TestController.test();
    request.getRequestDispatcher(path).forward(request, response);
     */


    @RequestMapping("/test")
    public String  test(MultipartFile file) throws IOException {


        String fileName = file.getOriginalFilename();
        long fileSize = file.getSize();
        file.transferTo(new File("D:\\test"));
        return "成功";




    }
}
